package com.byxy.shop.service.impl;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.byxy.shop.dao.GoodsInfoDao;
import com.byxy.shop.entity.GoodsInfo;
import com.byxy.shop.service.GoodsDetailService;
import com.byxy.ssm.shop.vo.GoodsDetailVO;

@Service
@Transactional
public class GoodsDetailServiceImpl implements GoodsDetailService {
	
	@Autowired
	private GoodsInfoDao goodsInfoDao;
	
	@Override
	public GoodsDetailVO getByGoodsId(Integer id) {
		GoodsInfo info = goodsInfoDao.getById(id);
		GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
		BeanUtils.copyProperties(info, goodsDetailVO);
		return goodsDetailVO;
	}

}
